<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Live extends Model
{
    protected $fillable = [
        'user_id',
        'name',
        'started_at',
        'ended_at',
        'user_count',
        'summary',
        'is_open_ask',
    ];

    protected $casts = [
        'is_open_ask' => 'boolean'
    ];

    protected $dates = [
        'started_at',
        'ended_at',
    ];

    public function configs()
    {
        return $this->morphMany(Config::class, 'configable');
    }
}
